<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>demo</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-GLhlTQ8iRABdZLl6O3oVMWSktQOp6b7In1Zl3/Jr59b6EGGoI1aFkw7cmDA6j6gD" crossorigin="anonymous">
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/js/bootstrap.bundle.min.js" integrity="sha384-/mhDoLbDldZc3qpsJHpLogda//BVZbgYuw6kof4u2FrCedxOtgRZDTHgHUhOCVim" crossorigin="anonymous"></script>
</head>
<body>
<div th:replace="~{common::myheader}"></div>

<script>
    let xhr=new XMLHttpRequest();//用来发请求的
    xhr.open("GET","http://localhost:8080/list1")//打开链接发送请求
    xhr.onreadystatechange=function (){
        if(xhr.readyState===4){
            if(xhr.status===200){
                console.log("成功")
                console.log(xhr.responseText);

                let parse = JSON.parse(xhr.responseText);
                console.log(parse)
            }else{
                console.log("出错了");
            }
        }
    }
    xhr.send();

</script>
</body>
</html>